//
//  HomeWhitePage.m
//  BGM
//
//  Created by liuqin on 2018/12/6.
//  Copyright © 2018 com.alirtc.demo. All rights reserved.
//

#import "HomeWhitePage.h"
#import "Common.h"


@interface HomeWhitePage ()

@property (nonatomic, strong)UILabel *label1;

@property (nonatomic, strong)UILabel *label2;
@property (nonatomic, strong)UILabel *label3;
@property (nonatomic, strong)UIButton *btn;


@end


@implementation HomeWhitePage

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self != nil) {
        
        UIImageView *bgImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
        [bgImage setImage:[UIImage imageNamed:@"HomeCard"]];
        [self addSubview:bgImage];
        
        
        float h = (bgImage.frame.size.height-40)/6;
        UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, frame.size.height-h, frame.size.width, h)];
         [bgImage addSubview:bottomView];
        
        
        
        
        
        
        self.label1 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height-h)];
        self.label1.text = @"无符合筛选条件的内容";
        self.label1.textColor = bgmgrayColor;
        self.label1.font = [UIFont systemFontOfSize:20];
        self.label1.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.label1];
        self.label1.hidden = YES;
        
        
        self.label2 = [[UILabel alloc]initWithFrame:CGRectMake(20, 60, frame.size.width-40,60)];
        self.label2.text = @"同步通讯录能够让您的朋友更好的发现您的帮忙信息，同时您也能够发现更多朋友的求助信息。";
        self.label2.textColor = bgmgrayColor;
        self.label2.numberOfLines = 0;
        self.label2.font = [UIFont systemFontOfSize:16];
        [self addSubview:self.label2];
        [self.label2 sizeToFit];
        self.label2.hidden = YES;

        self.label3 = [[UILabel alloc]initWithFrame:CGRectMake(20, 150, frame.size.width-40,30)];
        self.label3.text = @"【素友】承诺：我们保您的通讯录隐私安全，不会给您的朋友带来任何骚扰";
        self.label3.textColor = bgmyelloeColor;
        self.label3.numberOfLines = 0;
        self.label3.font = [UIFont systemFontOfSize:17];
        [self addSubview:self.label3];
        [self.label3 sizeToFit];
        self.label3.hidden = YES;

        
        self.btn = [[UIButton alloc]initWithFrame:CGRectMake(60, frame.size.height-140,  frame.size.width-120, 50)];
        self.btn.backgroundColor = bgmyelloeColor;
        [self.btn setTitle:@"同步通讯录" forState:UIControlStateNormal];
        [self.btn setTitleColor:bgmmainColor forState:UIControlStateNormal];
        self.btn.layer.cornerRadius = 25;
        self.btn.layer.masksToBounds = YES;
        [self.btn addTarget:self action:@selector(clickBtn) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:self.btn];
        self.btn.hidden = YES;

        
      
        
    }
    
    return self;
}

- (void)clickBtn{
    [self.homeDelegate clickOpenAddressBook];
}
-(void)homewhitePage{
    
    self.label1.hidden = NO;
    self.label2.hidden = YES;
    self.label3.hidden = YES;
    self.btn.hidden = YES;

}
-(void)homeNotOpenPage{
    
    self.label1.hidden = YES;
    self.label2.hidden = NO;
    self.label3.hidden = NO;
    self.btn.hidden = NO;
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
